/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.jm.acionista.entity;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author joao
 */
@Entity
@Table(name = "anotacao", catalog = "acionista", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "Anotacao.findAll", query = "SELECT a FROM Anotacao a")})
public class Anotacao implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "id_anotacao", nullable = false)
    private Integer idAnotacao;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "dsc_anotacao", nullable = false, length = 100)
    private String dscAnotacao;

    public Anotacao() {
    }

    public Anotacao(Integer idAnotacao) {
        this.idAnotacao = idAnotacao;
    }

    public Anotacao(Integer idAnotacao, String dscAnotacao) {
        this.idAnotacao = idAnotacao;
        this.dscAnotacao = dscAnotacao;
    }

    public Integer getIdAnotacao() {
        return idAnotacao;
    }

    public void setIdAnotacao(Integer idAnotacao) {
        this.idAnotacao = idAnotacao;
    }

    public String getDscAnotacao() {
        return dscAnotacao;
    }

    public void setDscAnotacao(String dscAnotacao) {
        this.dscAnotacao = dscAnotacao;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idAnotacao != null ? idAnotacao.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Anotacao)) {
            return false;
        }
        Anotacao other = (Anotacao) object;
        if ((this.idAnotacao == null && other.idAnotacao != null) || (this.idAnotacao != null && !this.idAnotacao.equals(other.idAnotacao))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.jm.acionista.entity.Anotacao[ idAnotacao=" + idAnotacao + " ]";
    }
    
}
